package com.tucy.logistics.modules.assist.file.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tucy.logistics.common.base.FileEntity;
import com.tucy.logistics.common.entity.user.SystemFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author tucy123
* @description 针对表【system_file(系统文件表)】的数据库操作Mapper
* @createDate 2023-07-06 15:11:58
* @Entity com.panda.admin.login.entity.SystemFile
*/
@Mapper
public interface SystemFileMapper extends BaseMapper<SystemFile> {
    /**
     * 更换头像
     * @param fileEntity
     * @return
     */
    @Update("update system_user set icon_url = #{fileEntity.filePath} where id = #{fileEntity.id}")
    Boolean updateIcon(@Param("fileEntity") FileEntity fileEntity);

    /**
     * 删除文件
     * @param ids
     * @return
     */
    Boolean deleteFileIds(@Param("ids") List<Long> ids);
}
